
    class PetDog {
        public String name;//名字
        public String color;//颜色
        // 狗的属性
        public void barks() {
            System.out.println(name + ": 旺旺旺~~~");
            System.out.println(name + " "+color+"的尾巴！！！");
        }
        // 狗的行为
        public void wag() {
            System.out.println(name + ": 摇尾巴~~~");
        }

public static void main(String[] args) {
    PetDog dog1 = new PetDog(); //通过new实例化对象
    dog1.name = "啦啦";
    dog1.color = "白色";
    dog1.barks();
    dog1.wag();
    System.out.println("---------------------------");
    PetDog dog2 = new PetDog();
    dog2.name = "哆哆";
    dog2.color = "白色";
    dog2.barks();
    dog2.wag();
    }
}